//
//  BaseControl.h
//  HTMAnimations
//
//  Created by Ting Han on 2017/9/14.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import <UIKit/UIKit.h>
@class BaseControl;

@protocol BaseControlDelegate <NSObject>

@optional

//点击触发事件
- (void)baseControlTouchEvent:(BaseControl *)control;


@end
/*
 target-action模式
 */
@interface BaseControl : UIView

//代理方法
@property (nonatomic,weak) id<BaseControlDelegate> delegate;

//目标
@property (nonatomic,weak) id target;

//控制事件
@property (nonatomic) SEL selector;

//容器
@property (nonatomic,strong,readonly) UIView *contentView;

//是否可用
@property (nonatomic,assign) BOOL enabled;

//是否选中
@property (nonatomic,assign) BOOL selected;

#pragma mark --- 子类重载方法

//触发了点击事件
- (void)touchUpInside;

//拖拽到rect之外，或者取消
- (void)touchDragExitOrTouchCancel;

//触摸开始或者从外部拖拽进来
- (void)touchBeginOrTouchDragEnter;

@end
